package com.gangwangchina.android.readsms;

import com.gangwangchina.android.readsms.config.Global;
import com.gangwangchina.android.readsms.service.readServer;
import com.gangwangchina.android.readsms.ui.BaseActivity;
import com.gangwangchina.android.readsms.ui.Settings;
import com.gangwangchina.android.readsms.R;
import com.shoushuo.android.tts.ITts;

import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;

public class ReadSms extends BaseActivity implements OnClickListener {


	public ImageButton btnSetting;
	
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.home);

		InitUICtrls();
		
		Global.Instance().Init(this);

		if (!Global.Instance().getReadSmsServerRunning()) {
			Intent intent = new Intent(this, readServer.class);
			startService(intent);
			Global.Instance().setReadSmsServerRunning(true);
		}
		
		
	}
	
	private void InitUICtrls()
	{
		btnSetting = (ImageButton) findViewById(R.id.imgbtn_setting);
		btnSetting.setOnClickListener((OnClickListener) this);
		
	}
	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.imgbtn_setting:
			startActivity(new Intent(this, Settings.class));
			break;
		default:
			break;
		}
	}


	
}